import React from "react";

import routeWithUserSession from "@/components/ApplicationArea/routeWithUserSession";
import PageHeader from "@/components/PageHeader";
import {  Col, Row} from 'antd/lib';
import "./Contract.css";
import FinishToolbar from "@/components/contract/FinishToolbar";
import routes from "@/services/routes";

class FinishNew extends React.Component {

  state = {
    items:[],//{
       id: "0",
    loading: true,
  };
  componentWillMount() {
    // var len = document.body.classList;
    // console.log(len);
    //  console.log(this.props);//val值
    // console.log(this.props.history.location.state);
    // console.log(this.props.location.state);
    // console.log(this.pageProps);
    let id;
    if(this.props.id===undefined){
      id=0;
    }else{
      id=this.props.id;//this.props.location.state.id;
    }
      this.setState({
            id: id,
            loading: false,
      });
    // timestruct.query('0').then(data => {
    //   this.setState({
    //         items: data,
    //         loading: false,
    //   });
    // });
    //this.refreshData();
  }
  render() {
    if (this.state.loading ) return null;
    return (
      <div className="settings-screen">
        <div className="container">
          <div  style={{width:"400px",height:"40px"}}>
            <div style={{width:"20px",height:"38px", float: "left"}}>
            </div>
              <div style={{width:"50px",height:"38px", float: "left"}}>
              <img src="/static/images/contractfinish.png"/>
            </div>
              <div style={{width:"320px",height:"30px",float:"left"}}>
              <h3 style={{margin:"7px",padding:"0"}}>合同验收申请单</h3>
            </div>
          </div>
        {/* <div>
            <Row height="20">
              <Col span={1}>
                <img src="/static/images/contractfinish.png"/>
              </Col>
              <Col span={10}>
                <PageHeader title="合同验收申请单" />
              </Col>
            </Row>
          </div> */}
          {/* <PageHeader title="合同验收申请单" /> */}
            <div className="p-15">
              <FinishToolbar  id={this.state.id} />
            </div>
        </div>
      </div>
    );
  }
}

routes.register(
  "Contractfinish.New",
  routeWithUserSession({
    path: "/contract/finish/new/:id",
    title: "合同验收申请单",
    render: pageProps => <FinishNew {...pageProps}/>,
  })
);
// export default [
//   routeWithUserSession({
//     path: "/contract/finish/new/:id",
//     title: "合同验收申请单",
//     render: pageProps => <FinishNew {...pageProps} />,
//   }),
// ];
